import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/index.vue'



Vue.use(VueRouter)

const routes = [
  {
    path:"/",
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    // meta 路由元信息 自定义的属性 可以供路由切换的时候所进行调用
    meta:{
      isShow:true
    }
  },

  {
    path: '/topic',
    name: 'topic',
    component: () => import('../views/topic/index.vue'),
    meta:{
      isShow:true
    }
  },
  {
    path: '/category',
    name: 'category',
    component: () => import('../views/category/index.vue'),
    meta:{
      isShow:true
    }
  },
 
  {
    path: '/category/:ids',
    name: 'categorylist',
    component: () => import('../views/category/list/index.vue'),
    meta:{
      isShow:true
    }
  },
  {
    path: '/cart',
    name: 'cart',
    component: () => import('../views/cart/index.vue'),
    meta:{
      isShow:true
    }
  },
  {
    path: '/my',
    name: 'my',
    component: () => import('../views/my/index.vue'),
    meta:{
      isShow:true
    }
  },
  {
    path: '/home/city',
    name: 'city',
    component: () => import('../views/home/city/index.vue'),
    meta:{
      isShow:false
    }
  },
  {
    path: '/home/search',
    name: 'search',
    component: () => import('../views/home/search/index.vue'),
    meta:{
      isShow:false
    }
  },
  {
    path: '/home/brand',
    name: 'brand',
    component: () => import('../views/home/brand/index.vue'),
    meta:{
      isShow:false
    }
  },
  {
    path: '/home/brand/:id3',
    name: 'brandlist',
    component: () => import('../views/home/brand/brandlist/index.vue'),
    meta:{
      isShow:false
    }
  },

  {
    path: '/home/:id2',
    name: 'goods',
    component: () => import('../views/home/goods/index.vue'),
    meta:{
      isShow:false
    }
  },

  {
    path: '/my/keep',
    name: 'keep',
    component: () => import('../views/my/keep/index.vue'),
    meta:{
      isShow:false
    }
  },

  {
    path: '/my/address',
    name: 'address',
    component: () => import('../views/my/address/index.vue'),
    meta:{
      isShow:false
    }
  },
  {
    path: '/my/detail',
    name: 'detail',
    component: () => import('../views/my/address/detail.vue'),
    meta:{
      isShow:false
    }
  },

  {
    path: '/my/feedback',
    name: 'Feedback',
    component: () => import('../views/my/feedback/index.vue'),
    meta:{
      isShow:false
    }
  },




  //
  {
    path: '/sousuo',
    name: 'sousuo',
    component: () => import('../views/home/search/index.vue'),
    meta:{
      isShow:true
    }
  },





  {
    path: '/xinpin/:id',
    name: 'xinpin',
    component: () => import('../views/home/xinpin/index.vue'),
    meta:{
      isShow:false
    }
  },


]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
